/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-10-15
 * Time: 12:27
 */
//找出一个字符串中最长的连续数字字符串

import java.util.*;
public class TestDemo {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String str=scanner.nextLine();
        String cur=" ";
        String ret=" ";
        int i=0;
        for(;i<str.length();i++){
            char ch=str.charAt(i);
            if(ch>'0'&&ch<'9'){
                cur=cur+ch+" ";

            }
//遍历到字母，就比较str和ret大小
            else{
                if(cur.length()>ret.length()){
                    ret=cur;
                }else{
                    cur=" ";
                }

            }


        }
        //考虑到遍历到数组长度下标的时候
        if(i==str.length()&&cur.length()>ret.length()){
            ret=cur;
        }
        System.out.println(ret);
    }
}
